﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DatabaseAccess
{
    public class ShortConnection: DBAccess
    {
        public ShortConnection(string connectionString):
            base(connectionString,SqlType.PostgresQL)
        { 
        
        }

        public override DataTable getDataTable(string sql)
        {
            //这里需要一个连接的过程，连接成功后，调用基类的该程序。

            try
            {
                if (Init())
                {
                    return base.getDataTable(sql);
                }
                else
                {
                    return null;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
            finally
            {
                Dispose();
            }
        }
    }
}
